package com.itcast.springboot3x;

import com.itcast.springboot3x.initializer.SecondInitializer;
import com.itcast.springboot3x.thread.ThreadPoolConfigurationProperties;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.EnableAspectJAutoProxy;

/**
 * 启东时如果出现启动不了 提示端口端口被占用 换了好几个都不行
 * 执行命令：lsof -i :8000 | grep LISTEN 查询使用端口的java.exe
 * 然后再执行kill -9 进程号
 * 最后重启启动
 */
@SpringBootApplication
@EnableAspectJAutoProxy(exposeProxy = true)
// 使配置的配置类生效
@EnableConfigurationProperties(ThreadPoolConfigurationProperties.class)
public class Springboot3xApplication {
    public static void main(String[] args) {
        // SpringApplication.run(Springboot3xApplication.class, args);
        // springboot 自定义初始化器的第二种方式
        SpringApplication springApplication = new SpringApplication(Springboot3xApplication.class) ;
        springApplication.addInitializers(new SecondInitializer());
        springApplication.run(args) ;
    }
}
